<%@ page language="java" import="java.util.*,info.guoyang.model.*,info.guoyang.basic.pool.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<link rel="StyleSheet" href="<%=basePath %>css/dtree.css" type="text/css" charset="GBK"/>
	<script type="text/javascript" src="<%=basePath %>js/dtree.js" charset="GBK"></script>
  
    <base href="<%=basePath%>">
    
    <title>My JSP 'dtreejava.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" charset="GBK" src="<%=basePath%>js/dtree.js"></script>
	<script type="text/javascript" charset="GBK">
	
		d = new dTree('d');
		
		//function additem(id,pid,name,url,title) {
		//	d.add(id,pid,name,url,title);
		//}
	</script>

  </head>
  
  <body>
    <%
    	if(Pool.DTREE.size()!=0) {
    	for(int i=0;i<Pool.DTREE.size();i++) {
    		Dtree dtree = Pool.DTREE.get(i);
    		response.setCharacterEncoding("GBK");
    		request.setCharacterEncoding("GBK");
System.out.println(dtree.getUrl() + " url " + i);    		
    %>	
   		<script type="text/javascript" charset="GBK">
	    	d.add(<%=dtree.getId()%>,<%=dtree.getPid()%>,'<%=dtree.getName()%>','<%=dtree.getUrl()%>','<%=dtree.getTitle()%>');
	    </script>
    <%		
    	}
    	}
     %>
     <script type="text/javascript" charset="GBK">
    	document.write(d);
    </script>
  </body>
</html>
